package com.citicpub_cloud.restfull.utils;

import java.io.File;

public class UploadUtils {

	public static String combinePath(String path1, String path2) {
		if (null != path1 && path1.length() > 0 && path1.endsWith("/")) {
			path1 = path1.substring(0, path1.length() - 1);
		}
		if (null != path2 && path2.length() > 0 && path2.startsWith("/")) {
			path2 = path2.substring(1);
		}
		return path1 + "/" + path2;
	}
	
	/**
	 * 将单位byte字节转换为m兆
	 * 
	 * @param lengthbtyes
	 * @return
	 */
	public static Long convertB2M(Long lengthbtyes) {
		if (lengthbtyes > 0) {
			return lengthbtyes / 1024 / 1024;
		}
		return Long.valueOf(0);
	}
}
